Documentation for class picture

Inherits from 	gadget 

Properties declared in picture 
	image 

Class Methods declared in picture 
	new 

Methods declared in picture 
	action 
		size_to_fit 
	any 
		image 
		rotate_by(delta_angle) 
		rotate_to(angle) 
		scale(x, y) 
		set_image(image) 
		size_to_fit 
	get 
		image 
	set 
		set_image(image) 

Class 
#begin_class
picture 
The class picture is a sub-class of the class gadget. 
A picture is a gadget that displays an image. If you scale or rotate a picture you actually rotate and scale the image of the picture.
Note: Any number of pictures may display the same image. If you rotate one picture and thus its image all pictures that displays that image will display a scaled and rotated image.
#end_class

Properties 

#begin_property
image 
Stores a reference to the image object that the picture displays.
Note: Any number of pictures may have references to the same image object.
#end_property

Methods 

#begin_method
image 
Returns the image property of the picture.
#end_method

#begin_method
rotate_by(delta_angle) 
Rotates the image of the picture by delta_angle degrees, resizes the picture to fit the new image size and redisplays the picture.
Returns self.
Note: All other pictures with the same image as the receiving picture will also be resized and redisplayed. If you do not want this to happen, send the rotate_by message directly to the image instead.
Ex:
{picture my_picture}:set_image({image my_image})
{picture my_picture}:rotate_by(45)
will rotate the image my_image by 45 degrees as well as resize and redisplay all pictures with the image my_image.
{picture my_picture}:set_image({image my_image})
{picture my_picture}:image:rotate_by(45)
will only rotate the image my_image by 45 degrees.
Also see rotate_by(delta_angle) (image)
#end_method

#begin_method
rotate_to(angle) 
Rotates the image of the picture to angle degrees, resizes the picture to fit the new image size and redisplays the picture.
Returns self.
Note: All other pictures with the same image as the receiving picture will also be resized and redisplayed. If you do not want this to happen, send the rotate_to message directly to the image instead.
Ex:
{picture my_picture}:set_image({image my_image})
{picture my_picture}:rotate_to(45)
will rotate the image my_image to 45 degrees as well as resize and redisplay all pictures with the image my_image.
{picture my_picture}:set_image({image my_image})
{picture my_picture}:image:rotate_to(45)
will only rotate the image my_image to 45 degrees.
Also see rotate_to(angle) (image)
#end_method

#begin_method
scale(x, y) 
Scales the image of the picture by x and y, resizes the picture to fit the new image size and redisplays the picture.
Returns self.
Note: All other pictures with the same image as the receiving picture will also be resized and redisplayed. If you do not want this to happen, send the scale message directly to the image instead.
Ex:
{picture my_picture}:set_image({image my_image})
{picture my_picture}:scale(2, 2)
will scale the image my_image by (2, 2) as well as resize and redisplay all pictures with the image my_image.
{picture my_picture}:set_image({image my_image})
{picture my_picture}:image:scale(2, 2)
will only scale the image my_image by (2, 2).
Also see scale(x, y) (image)
#end_method

#begin_method
set_image(image) 
Sets the image property to image.
Returns self.
#end_method

#begin_method
size_to_fit 
Resizes the picture to fit its image.
Returns self.
Note: This message must be sent to a picture after the image of the picture has changed its size.
#end_method

Class Methods 

#begin_class_method
new 
Returns a new picture object.
Ex:
p := {picture}:new
p:set_image({image next})
#end_class_method